import requests
import json
import os


def talk(info):
    key = "f7f198e4b96348d3b8deba0efa66ad2e"
    api = "http://www.tuling123.com/openapi/api?key=" + key + "&info=" + info
    res = requests.get(api)
    diect_json = json.loads(res.text)
    return diect_json["text"]


while True:
    info = input("我：")
    if info == "再见":
        print("机器人：再见")
        break
    else:
        yours = talk(info)
        print("机器人:" + yours)
